﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebAPIExample.Data.Models;

namespace WebAPIExample.Data
{
    public static class Seeder
    {
        public static void Seed(ApplicationDbContext context)
        {
            if (!context.Todos.Any())
            {
                context.Todos.Add(new Todo
                {
                    DateCompleted = DateTime.Now,
                    TaskName = "Go to lunch",
                    Timestamp = DateTime.Now.AddHours(-2)                    
                });

                context.Todos.Add(new Todo
                {
                    TaskName = "Learn WebAPI",
                    Timestamp = DateTime.Now.AddHours(-1)
                });
            }
        }
    }
}
